package com.mapforge.gui.map;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;

import javax.swing.JLabel;

import com.mapforge.listener.TilesetEditEvent;
import com.mapforge.listener.TilesetEditListener;
import com.mapforge.map.TileStamp;

public class TileStampLabel extends JLabel implements TilesetEditListener {

	/**
	 * Default serial version ID, here to remove warnings.
	 */
	private static final long serialVersionUID = 1L;
	private TileStamp tileStamp;

	public TileStampLabel() {
		this(null);
	}

	public TileStampLabel(TileStamp stamp) {
		this.tileStamp = stamp;
	}

	public Dimension getPreferredSize() {
		return new Dimension(100, 100);
	}

	public TileStamp getTileStamp() {
		return tileStamp;
	}

	public void setTileStamp(TileStamp stamp) {
		this.tileStamp = stamp;
	}

	@Override
	public void paint(Graphics g) {
		Graphics2D g2d = (Graphics2D) g;
		tileStamp.render(g2d);
	}

	@Override
	public void tilesetEditHappened(TilesetEditEvent evt) {

	}
}